package code.twopoint;

public class 移动零javaj {
    public static void main(String[] args) {

    }

    public static void moveZeroes(int[] nums) {
        int zeroPos = 0;
        int nonZeroPos = 0;
        while (nonZeroPos < nums.length) {
            if (nums[nonZeroPos] != 0) {
                int temp = nums[zeroPos];
                nums[zeroPos] = nums[nonZeroPos];
                nums[nonZeroPos] = temp;
                zeroPos++;
            }
            nonZeroPos++;
        }
    }
}
